省
<select class="easyui-validatebox province_id" name="province_id">
	<option value="0">请选择省份</option>
	<#list provinceList as province>
		<option value="${province.id}">${province.name}</option>
	</#list>
</select>
&nbsp;&nbsp;
市
<select class="easyui-validatebox city_id" name="city_id">
</select>
&nbsp;&nbsp;
区
<select class="easyui-validatebox region_id" name="region_id">
</select>

<script type="text/javascript">
	
$(".province_id").change(function(){
	var id=$(".province_id").val();
	
	if(id==null){
		$("body").overhang({
			type: "error",
			message: "请选择省份"
		});
		return null;
	}
	
	$.ajax({
		url:"${ctx}/core/admin/address/get-parent.do",
		data: {'pid':id},
		type:"POST",
		dataType:"json",
		success:function(result){
			var data=result.data;
			var length=data.length;
			$(".city_id").empty();
			$(".region_id").empty();
			$(".city_id").append("<option value='0'>请选择城市</option>")
			for(var i=0;i<length;i++){
				$(".city_id").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
			}
		},
		error:function(){
			$("body").overhang({
				type: "error",
				message: "请求错误！"
			});
			location.reload(); 
		}
	});
	
});


$(".city_id").change(function(){
	var id=$(".city_id").val();
	
	if(id==null){
		$("body").overhang({
			type: "error",
			message: "请选择城市"
		});
		return null;
	}
	$.ajax({
		url:"${ctx}/core/admin/address/get-area.do",
		data: {'pid':id},
		type:"POST",
		dataType:"json",
		success:function(result){
			var data=result.data;
			var length=data.length;
			$(".region_id").empty();
			for(var i=0;i<length;i++){
				$(".region_id").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
			}
		},
		error:function(){
			$("body").overhang({
				type: "error",
				message: "请求错误！"
			});
			location.reload(); 
		}
	});
	
});
	
</script>
